//---------------开始表示-----------------------
//===============结束表示=====================





//===================================================	
//------------------左右群轮换的图片----------------
	var x = 0;
	var speed = 0;
	var add = 0;
	var time3 = function(){};
	var time4 = function(){};
	big.onclick =function(){
		//alert(0000);	
		//if (run.style.left <= 2480&& )	
		var add =parseInt(run.style.left);
		speed = add;
		clearInterval(time4);
		runtime_right();
	}
	small.onclick =function(){
		clearInterval(time3);
		var add =parseInt(run.style.left);
		speed = add;
		runtime_left();

	}	
	function runtime_right(){
		
		time3 = setInterval(go_right,50);
	}
	function runtime_left(){
		time4 = setInterval(go_left,50);
	}


	function go_right(){
	
		var cont = parseInt(run.style.left);
		x += Math.PI/40;
		if(x >=0&&x < 0.5){
			speed -=1220/20*Math.pow(x,4);
		}else if ( x >= 0.5 && x <= (4/5)*Math.PI){	
			//alert(x);
			speed -=(1220/20)*Math.abs(Math.sin(x));
			//alert(speed);
		}else if( cont < -1220){
			speed +=15;
			if(-2420 >= cont&&cont >= -2440){
				speed = -2440;
				run.style.left = speed+'px';
				clearInterval(time3);
				x = 0;
			}

		}else if(-1200 >= cont&&cont >= -1220){	
			speed = -1220;
			run.style.left = speed+'px';
			clearInterval(time3);
			x = 0;
		} 		
	
		run.style.left = speed+'px';		
	}
	function go_left(){
		var cont = parseInt(run.style.left);
		x += Math.PI/40;
		if(x >=0&&x < 0.5){
			speed +=1240/20*Math.pow(x,4);
		}else if ( x >= 0.5 && x <= (4/5)*Math.PI){				
			speed +=(1240/20)*Math.abs(Math.sin(x));		
		}else if(cont > -1220 ){
			speed -= 15;			
			if(cont > 0&&cont < 20){	
			speed = 0;
			run.style.left = speed+'px';			
			clearInterval(time4);
			x = 0;
			if(cont >= -1260 && cont <= -1220 ){
				speed -= 0;
				speed = -1220;
				run.style.left = speed+'px';			
				clearInterval(time4);
				x = 0;
			}
			
		} 
		}		
		//alert(speed);
		run.style.left = speed+'px';	
	}

}

